<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of category_model
 * 
 * @author Subha Sundar Das (subhasundar.das@gmail.com)
 */
class Admin_review_model extends CI_Model {

    //put your code here


    function __construct() {
        parent::__construct();
	
        log_message('debug', 'Init Model Initialized');
    }
	function get_reviews($order_type=NULL, $num=NULL, $offset=NULL)
	{	$subcond = "";
		$limit = '';
		if ($num > 0)
			$limit = ' limit ' . $offset . ',' . $num;
		$sql="select * from review_master".$subcond. ' order by posted_on ' . $order_type . $limit;
		$query=$this->db->query($sql);
		$result=$query->result();
		return $result;
	}
	function change_status($status=NUll, $id=NULL)
	{
	$sql="update review_master set status=$status where id=$id";
	$this->db->query($sql);
	}	
	function delete($id=NULL)
	{
	print $id;
	die();
	$sql="delete from review_master where id=$id";
	$this->db->query($sql);
	}
   
   

}